import http from "@/utils/request";

export function loginByphone(params) {
    return http.request({
        url: "/User/loginByphone",
        method: "post",
        params: params,
    });
}

export function loginByEmail(params) {
    return http.request({
        url: "/User/loginByEmail",
        method: "post",
        params: params,
    });
}
export function addUser(params) {
    return http.request({
        url: "/User/addUser",
        method: "post",
        params: params,
    });
}
export function chanceUserDetail(params) {
    return http.request({
        url: "/User/chanceUserDetail",
        method: "post",
        params: params,
    });
}
export function tokenInfo(params) {
    return http.request({
        url: "/User/tokenInfo",
        method: "post",
        params,
    });
}
export function upFile(params) {
    return http.request({
        url: "/Tool/upFile",
        method: "post",
        data: params,
    });
}
export function getAllCollection(params) {
    return http.request({
        url: "/Collection/getAllCollection",
        method: "get",
        params,
    });
}
export function getUserDetailList(params) {
    return http.request({
        url: "/User/getUserDetailList",
        method: "get",
        params,
    });
}
// export function chanceUserDetail(params) {
//     return http.request({
//         url: "/User/chanceUserDetail",
//         method: "post",
//         params,
//     });
// }
export function uploadAvatarAPI(file,params) {
	let formData = new FormData();
	formData.append("file", file.file);
	formData.append("uid", params.uid);
	return http.post("/Tool/upFile", formData, {
		headers: {
			'enctype': 'multipart/form-data'
		},
	});
}
